<?xml version="1.0" encoding="windows-1250"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
 <xsl:output method="xml" encoding="windows-1250" indent="yes"/>    

 <xsl:template match="/Concept">

   <Concept id_concept="{@id_concept}" name="{@name}" pname="{@pname}" coll="{@coll}" active="{@active}">
     <Properties>
       
       <xsl:for-each select="CProperties/CProperty">
         <xsl:variable name="attr">
           <xsl:choose>
             <xsl:when test="@attr='0'">false</xsl:when>
             <xsl:otherwise>true</xsl:otherwise>
           </xsl:choose>
         </xsl:variable>
         <xsl:variable name="cntr">
           <xsl:choose>
             <xsl:when test="@cntr='0'">false</xsl:when>
             <xsl:otherwise>true</xsl:otherwise>
           </xsl:choose>
         </xsl:variable>
         <xsl:variable name="key">
           <xsl:choose>
             <xsl:when test="@key='0'">false</xsl:when>
             <xsl:otherwise>true</xsl:otherwise>
           </xsl:choose>
         </xsl:variable>
         <xsl:variable name="mandat">
           <xsl:choose>
             <xsl:when test="@mandat='0'">false</xsl:when>
             <xsl:otherwise>true</xsl:otherwise>
           </xsl:choose>
         </xsl:variable>
         <xsl:variable name="onlabel">
           <xsl:choose>
             <xsl:when test="@onlabel='0'">false</xsl:when>
             <xsl:otherwise>true</xsl:otherwise>
           </xsl:choose>
         </xsl:variable>
         <xsl:variable name="ref">
           <xsl:choose>
             <xsl:when test="@ref and @ref='*'"></xsl:when>
             <xsl:otherwise><xsl:value-of select="@ref"/></xsl:otherwise>
           </xsl:choose>
         </xsl:variable>   
         <xsl:variable name="type">
           <xsl:choose>
             <xsl:when test="@key='1' or string-length($ref)&gt;0">char</xsl:when>
             <xsl:otherwise><xsl:value-of select="@type"/></xsl:otherwise>
           </xsl:choose>
         </xsl:variable>
         <xsl:variable name="default"><!-- default is only a matter of GUI entry, unless it is hidden or mandatory -->
           <xsl:choose>
             <xsl:when test="@oncreate!='show' or @mandat='1'"><xsl:value-of select="@default"/></xsl:when>
             <xsl:otherwise></xsl:otherwise>
           </xsl:choose>
         </xsl:variable>
         <xsl:variable name="len">
           <xsl:choose>
             <xsl:when test="@key='1' or string-length($ref)&gt;0">36</xsl:when>
             <xsl:otherwise><xsl:value-of select="@len"/></xsl:otherwise>
           </xsl:choose>
         </xsl:variable>
         <Property 
           attr="{$attr}"
           cntr="{$cntr}" 
           default="{$default}" 
           fetchtype="{@fetchtype}" 
           hiddenkey="{@hiddenkey}"
           id_concept="{@id_concept}"
           id_property="{@id_cproperty}" 
           key="{$key}" 
           len="{$len}" 
           mandat="{$mandat}"
           name="{@name}" 
           numrows="{@numrows}" 
           oncreate="{@oncreate}"
           ondetail="{@ondetail}" 
           onedit="{@onedit}" 
           onfilter="{@onfilter}"
           onlabel="{$onlabel}" 
           onlist="{@onlist}" 
           position="{@position}" 
           ref="{$ref}"
           type="{$type}">
           
         </Property>       
       </xsl:for-each>

     </Properties>
   </Concept>
 </xsl:template>
 


</xsl:stylesheet>
       
 
